<%@ taglib prefix="s" uri="/struts-tags"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="basestyle.css">
</head>
<body id="layout">
	<div id="bodyheader">View Clients</div>
	<br></br>
	<div id="bodystyle">
	<table id="datatable">
	<tr>
		
		<th><s:text name="Client ID"/></th>
		<th><s:text name="Client Name"/></th>
		<th><s:text name="User ID" /></th>
		<th><s:text name="User Name" /></th>
		<th><s:text name="Password"/></th>
		<th><s:text name="Role"/> </th>
		<th><s:text name="Edit Client"/></th>
	</tr>
	<s:iterator value="data" status="status">
		<tr class="<s:if test="#status.even">even</s:if><s:else>odd</s:else>">
		<s:iterator>
			<s:set var="uid" value="key"/>
			<s:if test="%{#uid=='client'}">
				<s:set var="ct" value="value"/>
				<td><s:property value="#ct.clientId"/></td>
				<td><s:property value="#ct.clientName"/></td>
			</s:if>
			
			<s:else>
				<s:set var="usr" value="value"/>
				<td><s:property value="#usr.userId"/></td>
				<td><s:property value="#usr.username"/></td>
				<td><s:property value="#usr.password"/></td>
				<td><s:property value="#usr.role"/></td>
				<td>
				<a href="<s:url action="editClient">
					<s:param name="userId" value="#usr.userId"/>
					<s:param name="username" value="#usr.username"/>
					<s:param name="pswd" value="#usr.password"/></s:url>">
					Edit Client
				</a>
				</td>
			</s:else> 
		</s:iterator>
		</tr>
	</s:iterator>
	</table>
	<br></br>
	</div>
</body>
</html>